package cn.com.wanywhn.a2017_04_02_bmob_brvah.Adapter;

import com.chad.library.adapter.base.BaseSectionQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import cn.com.wanywhn.a2017_04_02_bmob_brvah.Bean.CategroyBean;
import cn.com.wanywhn.a2017_04_02_bmob_brvah.Data.CategroyDataSection;
import cn.com.wanywhn.a2017_04_02_bmob_brvah.Data.CategroyData;
import cn.com.wanywhn.a2017_04_02_bmob_brvah.R;

/**
 * Created by tender on 17-4-2.
 */

public class CategroyAdapter extends BaseSectionQuickAdapter<CategroyDataSection, BaseViewHolder> {


    public CategroyAdapter(int layoutResId, int sectionHeadResId, List<CategroyDataSection> data) {
        super(layoutResId, sectionHeadResId, data);
    }


    @Override
    protected void convertHead(BaseViewHolder helper, CategroyDataSection item) {
        helper.setText(R.id.header, item.header);
        helper.setVisible(R.id.more, item.isMore());
        helper.addOnClickListener(R.id.more);
    }

    @Override
    protected void convert(BaseViewHolder helper, CategroyDataSection item) {

        CategroyBean cb = item.t;
        helper.setText(R.id.categroy_title, cb.getName());
        helper.setText(R.id.categroy_descrip, cb.getDescribe());
        helper.setImageResource(R.id.categroy_image, R.mipmap.image);
    }
}
